package actions;

import gui.Frame;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

/**
 * An action to display a job form so that a manager can create a new job. 
 * 
 * @author Natalie
 *
 */
@SuppressWarnings("serial")
public class CreateJobAction extends AbstractAction {

	private final Frame myFrame;

	public CreateJobAction(final Frame theFrame) {
		super("Submit a New Job Request");
		myFrame = theFrame;
	}
	
	/**
	 * Sets the previous action to be the last screen that would have been displayed. 
	 * Displays the job form to the park manager. 
	 */
	@Override
	public void actionPerformed(final ActionEvent theEvent) {
		myFrame.setPreviousAction(new HomeAction(myFrame));
		myFrame.displayJobForm();
	}

}
